﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Dal;
using Model;
using DalEx;


public partial class ZhaoShengBaoMing : System.Web.UI.PageEx
{
    private DataSet ds;
    public static string showStaDateShow = "style=\"display:none;\"";

    private void DataBinds()
    {
        this.ds = DbCompInfoDal.Select(" and cStatus=1");
        this.rptType.DataSource = this.ds;
        this.rptType.DataBind();
        DbCompInfo model = DbCompInfoEx.GetModel("BaoMing");
        if (model != null)
        {
            this.setMeta(model.CName, model.CKeywords, model.CDescription);
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!DalEx.DbSystemEx.ReadBaoMingState())
        {
            Response.Redirect("404.aspx");
        }
        if (!this.Page.IsPostBack)
        {
            this.DataBinds();
        }
    }

    private void setMeta(string title, string key, string des)
    {
        string sTitle = string.Empty;
        string sKeywords = string.Empty;
        string sDescription = string.Empty;
        DbSystem system = DbSystemDal.Select(1);
        if (system != null)
        {
            sTitle = system.STitle;
            sKeywords = system.SKeywords;
            sDescription = system.SDescription;
        }
        HtmlMeta child = new HtmlMeta();
        HtmlMeta meta2 = new HtmlMeta();
        child.Name = "keywords";
        child.Content = string.IsNullOrEmpty(key) ? sKeywords : key;
        base.Title = string.IsNullOrEmpty(title) ? sTitle : title;
        meta2.Name = "description";
        meta2.Content = string.IsNullOrEmpty(des) ? sDescription : des;
        this.Page.Header.Controls.Add(child);
        this.Page.Header.Controls.Add(meta2);
    }
}
